<?php
// +----------------------------------------------------------------------
// | ThinkSNS
// +----------------------------------------------------------------------
// | Copyright (c) 2009 http://www.thinksns.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: nonant <nonant@thinksns.com>
// +----------------------------------------------------------------------
//

class BaseAction extends Action{
	var $visitUid = ''; //被浏览者Uid
	
	function _initialize(){
		$uid = trim($_GET['uid']);
		if(is_numeric($uid)){
			$spaceInfo = D('Space')->where('uid='.intval($uid))->field('uid,cardId,credit_exp,credit_score')->find();
		}else{
			$spaceInfo = D('Space')->where("cardId='$uid'")->field('uid,cardId,credit_exp,credit_score')->find();
		}
		$this->visitUid = $spaceInfo['uid'];
		$this->assign('uid',$this->visitUid);
				
		if(0==D('Space','home')->where('uid='.$this->visitUid)->count()){
			$this->error( L('base_0001') );
		}else{
			$userInfo = M('User')->where('uid='.$this->visitUid)->field('uid,uname,sex')->find();
			$this->assign('userInfo',$userInfo);
			$this->assign('spaceInfo',$spaceInfo);
		}

		
	}
}